package com.project.controller;

import com.project.bean.ChannelBean;
import com.project.servic.IChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("channel")
public class ChannelController {
    @Autowired
    private IChannelService service;

    /**
     * 查询所有频道
     * @return
     */
    @RequestMapping("findAll")
    private List<ChannelBean> findAll(){
        return service.findAll();
    }

    /**
     * 根据id查询频道，同时查询该频道有多少主贴
     * @param id
     * @return
     */
    @RequestMapping("findById")
    private ChannelBean findById(Integer id){
    return service.findById(id);
    }
}
